<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

	<!-- 数据库连接池配置 -->
	
	<bean id="propertyConfigurer"
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<list>
				<value>classpath:dbsource-oracle.properties</value>
				<value>classpath:hibernate.properties</value>
				<value>classpath:poc-config.properties</value>
				<value>classpath:sp-server.properties</value>
			</list>
		</property>
	</bean>
	
	<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
		<property name="driverClass" value="${jdbc.driverClass}" />
		<property name="jdbcUrl" value="${jdbc.url}" />
		<property name="user" value="${jdbc.user}" />
		<property name="password" value="${jdbc.password}" />
		<property name="autoCommitOnClose" value="${jdbc.autoCommitOnClose}" />
		<property name="checkoutTimeout" value="${cpool.checkoutTimeout}"/>
		<property name="initialPoolSize" value="${cpool.minPoolSize}"/>
		<property name="minPoolSize" value="${cpool.minPoolSize}"/>
		<property name="maxPoolSize" value="${cpool.maxPoolSize}"/>
		<property name="maxIdleTime" value="${cpool.maxIdleTime}"/>
		<property name="acquireIncrement" value="${cpool.acquireIncrement}"/>
	</bean>
	
	<!-- blog 字段处理 -->
	<!--  
	<bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler"
		lazy-init="true">
	</bean>
	-->
	
	<!--bean id="nativeJdbcExtractor" lazy-init="true" class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor"/>
	<bean id="lobHandler" lazy-init="true" class="org.springframework.jdbc.support.lob.OracleLobHandler">
		<property name="nativeJdbcExtractor" ref="nativeJdbcExtractor"/>
	</bean-->

	<!-- blog 字段处理 -->
	<bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler"
		lazy-init="true">
	</bean>

	<bean id="sessionFactory"
		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
		<property name="dataSource">
			<ref bean="dataSource" />
		</property>
		<property name="lobHandler" ref="lobHandler"/>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">
					${hibernate.dialect}
				</prop>
				<prop key="show_sql">
					${hibernate.show_sql}
				</prop>
			</props>
		</property>
		<property name="mappingResources">
			<list>
				<!-- common -->
				<value>cn/ffcs/common/model/Attach.hbm.xml</value>	
				<!-- security -->
				<value>cn/ffcs/security/model/User.hbm.xml</value>
				<value>cn/ffcs/security/model/Role.hbm.xml</value>	
				<value>cn/ffcs/security/model/RoleRelaUser.hbm.xml</value>	
				<value>cn/ffcs/security/model/RoleRelaResource.hbm.xml</value>		
				<value>cn/ffcs/security/model/Resource.hbm.xml</value>	
				<value>cn/ffcs/security/model/UserResource.hbm.xml</value>	
				<!-- system manage -->
				<value>cn/ffcs/system/dict/model/DictType.hbm.xml</value>	
				<value>cn/ffcs/system/dict/model/Dict.hbm.xml</value>		
				<!-- sort -->
				<value>cn/ffcs/sort/model/ProductSort.hbm.xml</value>
				<!-- product -->
				<value>cn/ffcs/product/model/Product.hbm.xml</value>
				<value>cn/ffcs/ref/model/ProductRefSort.hbm.xml</value>
				<value>cn/ffcs/product/model/ProductReference.hbm.xml</value>
				<value>cn/ffcs/productdict/model/ProductDict.hbm.xml</value>
				<value>cn/ffcs/productdict/model/ProductInfo.hbm.xml</value>
				<value>cn/ffcs/product/model/ProductManager.hbm.xml</value>
				<!-- organ -->
				<value>cn/ffcs/organ/model/Person.hbm.xml</value>
				<value>cn/ffcs/organ/model/Organization.hbm.xml</value>
				<value>cn/ffcs/organ/model/OrgRelaPerson.hbm.xml</value>
				<value>cn/ffcs/organ/model/LinkMethod.hbm.xml</value>
				<!-- share -->
				<value>cn/ffcs/share/model/ShareReference.hbm.xml</value>
				<!-- businessrequest -->
				<value>cn/ffcs/businessrequest/model/BusinessRequest.hbm.xml</value>
				<value>cn/ffcs/businessrequest/model/BusinessReason.hbm.xml</value>
				<value>cn/ffcs/businessrequest/model/NewprodReq.hbm.xml</value>
				<value>cn/ffcs/businessrequest/model/ProdAdvReq.hbm.xml</value>
				<value>cn/ffcs/businessrequest/model/ReqDocu.hbm.xml</value>
				<value>cn/ffcs/businessrequest/model/DocContent.hbm.xml</value>
				<value>cn/ffcs/businessrequest/model/ReqProgAttach.hbm.xml</value>
				<value>cn/ffcs/businessrequest/model/ReqProgress.hbm.xml</value>
				<value>cn/ffcs/businessrequest/model/ReqDelay.hbm.xml</value>
				<!-- bpm -->
				<value>cn/ffcs/bpm/model/ProcessStep.hbm.xml</value>
				<value>cn/ffcs/bpm/model/ProcessConfig.hbm.xml</value>
				<value>cn/ffcs/bpm/model/TransactorType.hbm.xml</value>
				<value>cn/ffcs/bpm/model/ProcessConfigDetail.hbm.xml</value>
				<value>cn/ffcs/bpm/model/NextTep.hbm.xml</value>
				<value>cn/ffcs/bpm/model/TransactProcessStatus.hbm.xml</value>
				<value>cn/ffcs/bpm/model/Transactor.hbm.xml</value>
				<value>cn/ffcs/bpm/model/ProcTranRecord.hbm.xml</value>
				<value>cn/ffcs/bpm/model/Part.hbm.xml</value>
				<value>cn/ffcs/bpm/model/PartRelaUser.hbm.xml</value>
				<value>cn/ffcs/bpm/model/DocumentType.hbm.xml</value>
				<!-- search -->
                <value>cn/ffcs/search/model/Search.hbm.xml</value>
				<!-- contract -->
				<value>cn/ffcs/contract/model/ContractInfo.hbm.xml</value>
				<value>cn/ffcs/contract/model/ContractUpload.hbm.xml</value>
				<!-- 
				<value>cn/ffcs/contract/model/ContractUpload.hbm.xml</value>
				 -->
				<value>cn/ffcs/contract/model/ContractRecord.hbm.xml</value>
                <value>cn/ffcs/contract/model/VContractInfo.hbm.xml</value>
                <value>cn/ffcs/contract/model/TContractRemind.hbm.xml</value>
                <value>cn/ffcs/contract/model/ContractBussout.hbm.xml</value>
				<value>cn/ffcs/tmp/model/Annex.hbm.xml</value>
                <!-- flow pvc start -->
                <value>cn/ffcs/bpmpvc/model/BpmSwimlane.hbm.xml</value>
                <value>cn/ffcs/bpmpvc/model/TPocDocTemplete.hbm.xml</value>
                <value>cn/ffcs/bpmpvc/model/TPocReqPlan.hbm.xml</value>
                <value>cn/ffcs/bpmpvc/model/TBpmAppInfo.hbm.xml</value>
                <value>cn/ffcs/bpmpvc/model/TAppSms.hbm.xml</value>
                <value>cn/ffcs/bpmpvc/model/TAppBusinessAnalysis.hbm.xml</value>
                
                <!-- cn.ffcs.bpm.model.Message -->
                <value>cn/ffcs/bpm/model/Message.hbm.xml</value>
                
                  <!-- cn.ffcs.bpm.model.Report -->
                <value>cn/ffcs/bpm/model/Report.hbm.xml</value>
				 <!-- cn.ffcs.bpm.model.DateControl -->
                <value>cn/ffcs/bpm/model/DateControl.hbm.xml</value>
			</list>
		</property>
	</bean>
	
	<!-- hibernate transction manager -->
	<bean id="transactionManager"
		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>
	
	<bean id="baseTransactionProxy"
		class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
		abstract="true">
		<property name="transactionManager" ref="transactionManager" />
		<property name="transactionAttributes">
			<props>
				<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="select*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="query*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="save*">
					PROPAGATION_REQUIRED,-AppBaseException
				</prop>
				<prop key="insert*">
					PROPAGATION_REQUIRED,-AppBaseException
				</prop>
				<prop key="update*">
					PROPAGATION_REQUIRED,-AppBaseException
				</prop>
				<prop key="delete*">
					PROPAGATION_REQUIRED,-AppBaseException
				</prop>
				<prop key="execute*">
					PROPAGATION_REQUIRED,-AppBaseException
				</prop>
				<prop key="*">
					PROPAGATION_REQUIRED,-AppBaseException
				</prop>
			</props>
		</property>
	</bean>
		
	<!-- 引入dao上下文配置文件 -->
	<import resource="classpath:cn/ffcs/common/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/bpm/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/security/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/system/dict/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/sort/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/product/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/ref/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/productdict/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/organ/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/share/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/businessrequest/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/search/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/contract/application-dao.xml"/>
	<import resource="classpath:cn/ffcs/tmp/application-dao.xml"/>
	<!-- 引入service上下文配置文件 -->
	<import resource="classpath:cn/ffcs/common/application-service.xml"/>
	<import resource="classpath:cn/ffcs/bpm/application-service.xml"/>
	<import resource="classpath:cn/ffcs/security/application-service.xml"/>
	<import resource="classpath:cn/ffcs/security/application-security-context.xml"/>
	<import resource="classpath:cn/ffcs/system/dict/application-service.xml"/>
	<import resource="classpath:cn/ffcs/sort/application-service.xml"/>
	<import resource="classpath:cn/ffcs/product/application-service.xml"/>
	<import resource="classpath:cn/ffcs/ref/application-service.xml"/>
	<import resource="classpath:cn/ffcs/productdict/application-service.xml"/>
	<import resource="classpath:cn/ffcs/organ/application-service.xml"/>
	<import resource="classpath:cn/ffcs/share/application-service.xml"/>
	<import resource="classpath:cn/ffcs/businessrequest/application-service.xml"/>
	<import resource="classpath:cn/ffcs/search/application-service.xml"/>
	<import resource="classpath:cn/ffcs/contract/application-service.xml"/>
	<import resource="classpath:cn/ffcs/tmp/application-service.xml"/>
	<!-- 引入action bean上下文配置文件 -->
	<import resource="classpath:cn/ffcs/common/application-action.xml"/>
	<import resource="classpath:cn/ffcs/bpm/application-action.xml"/>
	<import resource="classpath:cn/ffcs/security/application-action.xml"/>
	<import resource="classpath:cn/ffcs/system/dict/application-action.xml"/>
	<import resource="classpath:cn/ffcs/sort/application-action.xml"/>
	<import resource="classpath:cn/ffcs/product/application-action.xml"/>
	<import resource="classpath:cn/ffcs/ref/application-action.xml"/>
	<import resource="classpath:cn/ffcs/productdict/application-action.xml"/>
	<import resource="classpath:cn/ffcs/organ/application-action.xml"/>
	<import resource="classpath:cn/ffcs/share/application-action.xml"/>
	<import resource="classpath:cn/ffcs/businessrequest/application-action.xml"/>
	<import resource="classpath:cn/ffcs/sp/application-action.xml"/>
	<import resource="classpath:cn/ffcs/search/application-action.xml"/>
	<import resource="classpath:cn/ffcs/contract/application-action.xml"/>
	<import resource="classpath:cn/ffcs/tmp/application-action.xml"/>
	
	<import resource="classpath:cn/ffcs/bpmpvc/quartz/applicationContext-quartz.xml"/>
</beans>